GlobalToLocal
Point *thePoint ; global Point; receives local coordinates GlobalToLocal converts a point from global ( screen) coordinates to values expressed in coordinates of the current GrafPort. It is used to obtain the local address of a mouse-down event and as a step in converting between coordinates
of two different grafPorts.
thePoint is the address of a 4-byte Point structure, expressed in global ( screen) coordinates. Upon return, it will contain the coordinates of
that same position, expressed in the coordinate system of the current
Notes: The specified Point is converted, in place. Upon return, it is the same physical location, expressed in global coordinates.
For instance, mouse-down events are reported in global coordinates, but
TextEdit and the Control Manager functions expect local ( window- relative)
coordinates. Thus, a typical sequence may include:
short ctlCode;
if ( myEvent.what ) == mouseDown {
if ( ctlCode == inThumb )
/*. . . etc. . . */
}
This function is also used as an intermediate step in converting between
coordinates of two different grafPorts (e.g., windows). For instance, to
convert the position of rectangle theRect from the coordinates of windowA
to the coordinates of windowB :
To convert between the coordinates of regions and polygons, calculate the